namespace SimpleWebServices.Models
{
    using System;
    using System.Web.Mvc;
    using SimpleWebServices.Web.Mvc;

    public sealed class SubmissionDebug : IProcessSubmission
    {
        public ActionResult Process(FormSubmission submission)
        {
            if (null == submission)
            {
                throw new ArgumentNullException("submission");
            }
            else if (!submission.Token.HasValue)
            {
                throw new ArgumentOutOfRangeException("submission");
            }

            return new SeeOtherResult("/debug/submission?" + submission.Token.Value);
        }
    }
}